import requests from '@/utils/axios';
interface AddDatas {
  standardId?: String;
  codesId: String | null;
  standardName: String;
  standardEnglish: String;
  standardMsg: String | null;
  standardSource: String;
  standardIsNull: Number;
  standardDataType: Number;
  standardDefault: string | Number | null;
  standardDataLength: Number | null;
  standardDataAccuracy: Number | null;
  standardDataMax: String | null;
  standardDataMin: String | null;
}
interface DataPartStandard {
  standardSource?: string;
  standardStatus?: number;
  standardId?: string;
  standardName?: string;
  standardEnglish?: string;
}

//   /standard/getAllInterface   get 全查询
export const getAllStandard = () => requests({ url: '/standard/getAllInterface', method: 'get' });

///standard/addStandard  post 新增
export const AddStandard = (data: AddDatas) => requests({ url: '/standard/addStandard', method: 'post', data });

//  /standard/updateStandardardInfor  put 编辑
export const modifyStandard = (data: AddDatas) => requests({ url: '/standard/updateStandardardInfor', method: 'put', data });
// POST  /standard/getInterfaceByTerm 条件查询
export const getPartStandard = (data?: DataPartStandard) => requests({ url: '/standard/getInterfaceByTerm', method: 'post', data });

// GET /standard/getSource  下拉框数据来源
export const findSource = () => requests({ url: '/standard/getSource', method: 'get' });

// PUT /standard/updateStandardsStatus/{standardId}  修改状态
export const changeStatus = (data: { standardId: string; standardStatus: number }) => requests({ url: `/standard/updateStandardsStatus/${data.standardId}`, method: 'put', data });

// PUT /standard/updateStandardsStatusList  批量修改状态
export const changeAllStatus = (data: { standardId: string[]; standardStatus: number }) => requests({ url: '/standard/updateStandardsStatusList', method: 'put', data });

// DELETE /standard/deleteStandard  删除
export const deleteStandard = (params: { standardId: string }) => requests({ url: '/standard/deleteStandard', method: 'delete', params });
